#include <stdio.h>
#include "esp_log.h"
#include "driver/i2c_master.h"


i2c_master_bus_handle_t iic0_handle;

void iic_init(void)
{
    i2c_master_bus_config_t i2c_bus_config = {
        .clk_source = I2C_CLK_SRC_DEFAULT,
        .i2c_port = CONFIG_I2C_PORT,
        .scl_io_num = CONFIG_I2C_SCL_PIN,
        .sda_io_num = CONFIG_I2C_SDA_PIN,
        .glitch_ignore_cnt = 7,
        .flags.enable_internal_pullup = true,
    };

    ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_config, &iic0_handle));
}
